import request from './request'
import { useUserStore } from "../store/modules/user"

// 同步服务页面
export function getSyncService() {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/system/service/page/syncServicePage',
        method: 'get',
        headers: token
        
    })
}


// 获取服务页面列表
export function getSyncList(data) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/system/service/page/getList',
        method: 'post',
        headers: token,
        data
    })
}

//修改服务页面标题与状态
export function getmodifyEmp(data) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/system/service/page/udpateServicePageTitle',
        method: 'put',
        headers: token,
        data
    })
}


//根据页面ID获取页面标题详情
export function getmodifyidInfo(id:any) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/system/service/page/ServicePageTitleDetail/' + id,
        method: 'get',
        headers: token,
    
    })
}

//批量启用或禁用服务页面
export function getBatchEnaDis(data,status){
    let token ={
        'access-token': useUserStore().token
    }
    return request({
        url: '/system/service/page/disable',
        method: 'put',
        headers: token,
        data,
        params: { status }
    })
}


//根据页面ID获取二维码详情
export function getgenerateInfo(id:any) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/system/service/page/getServicePageQrDetail/' + id,
        method: 'get',
        headers: token,
    
    })
}



// 修改服务页面二维码信息
export function getgeneratedata(data) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/system/service/page/updateServicePageQr',
        method: 'put',
        headers: token,
        data
    })
}